#if !defined(SPHERE_HPP)
#define SPHERE_HPP

#include <memory>

#include "Eigen"

#include "Object.hpp"
#include "Material.hpp"
#include "Lambertian.hpp"

class Sphere :public Object {
private:
    // 圆心位置
    Eigen::Vector3f pos;
    // 半径
    float radius;
    // 材质指针
    std::shared_ptr<Material> mat;

public:
    Sphere(){}
    Sphere(const Eigen::Vector3f& position, float radius)
        :pos(position), radius(radius), mat(std::make_shared<Lambertian>(Lambertian()))
    {}
    Sphere(const Eigen::Vector3f& position, float radius, std::shared_ptr<Material> material)
        :pos(position), radius(radius), mat(material)
    {}
    std::optional<ShadePayload> hit(const Ray& ray)const override;
};
#endif // SPHERE_HPP